package com.newa.actions;

import java.net.URLDecoder;
import java.net.URLEncoder;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class lang extends ActionSupport {
	private String url;
	private String[] avL = { "ru", "en", "cz" };
	private int id;
	private String from;
	private int orderm;

	@Override
	public String execute() throws Exception {
		String locale = ActionContext.getContext().getLocale().getLanguage();

		int i;
		for (i = 0; i < avL.length; i++) {
			if (avL[i].equals(locale)) {
				break;
			}
		}
		if(i>2){
			return "error";
		}
		if(from!=null&&from.equals("works.jsp")){
			return "successW";
		} else if(from!=null&&from.equals("onework.jsp")){
			return "onework";
		}
		return "success";
	}


	public int getOrderm() {
		return orderm;
	}


	public void setOrderm(int orderm) {
		this.orderm = orderm;
	}


	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
